package com.bailiban.controller;

import com.bailiban.entity.CityCov;
import com.bailiban.service.CityCovService;
import com.bailiban.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhulang
 * @Classname CityCovController
 * @Description TODO
 * @Date 2020/3/25 15:19
 */
@RestController
@RequestMapping("/cityCov")
public class CityCovController {
    @Autowired
    private CityCovService cityCovService;
    @GetMapping("/all/provinceId/{provinceId}")
    public Result findAllByProvinceId(@PathVariable(name = "provinceId") Integer provinceId){
        List<CityCov> all = cityCovService.findAllByProvinceId(provinceId);
        return Result.success(all);
    }
}
